Skip to content

chore: token-interface#2362

Open
SwenSchaeferjohann wants to merge 23 commits intomainfrom
swen/single-ix
Open

chore: token-interface#2362
SwenSchaeferjohann wants to merge 23 commits intomainfrom
swen/single-ix

Conversation

@SwenSchaeferjohann
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (58)
  • .github/workflows/js-token-interface-v2.yml is excluded by none and included by none
  • .gitignore is excluded by none and included by none
  • js/justfile is excluded by none and included by none
  • js/token-interface/.prettierrc is excluded by none and included by none
  • js/token-interface/README.md is excluded by none and included by none
  • js/token-interface/eslint.config.cjs is excluded by none and included by none
  • js/token-interface/package.json is excluded by none and included by none
  • js/token-interface/rollup.config.js is excluded by none and included by none
  • js/token-interface/src/account.ts is excluded by none and included by none
  • js/token-interface/src/constants.ts is excluded by none and included by none
  • js/token-interface/src/errors.ts is excluded by none and included by none
  • js/token-interface/src/helpers.ts is excluded by none and included by none
  • js/token-interface/src/index.ts is excluded by none and included by none
  • js/token-interface/src/instructions/_plan.ts is excluded by none and included by none
  • js/token-interface/src/instructions/approve.ts is excluded by none and included by none
  • js/token-interface/src/instructions/ata.ts is excluded by none and included by none
  • js/token-interface/src/instructions/burn.ts is excluded by none and included by none
  • js/token-interface/src/instructions/freeze.ts is excluded by none and included by none
  • js/token-interface/src/instructions/index.ts is excluded by none and included by none
  • js/token-interface/src/instructions/layout/layout-mint-action.ts is excluded by none and included by none
  • js/token-interface/src/instructions/layout/layout-mint.ts is excluded by none and included by none
  • js/token-interface/src/instructions/layout/layout-transfer2.ts is excluded by none and included by none
  • js/token-interface/src/instructions/layout/layout.ts is excluded by none and included by none
  • js/token-interface/src/instructions/load.ts is excluded by none and included by none
  • js/token-interface/src/instructions/load/decompress.ts is excluded by none and included by none
  • js/token-interface/src/instructions/load/select-primary-cold-account.ts is excluded by none and included by none
  • js/token-interface/src/instructions/revoke.ts is excluded by none and included by none
  • js/token-interface/src/instructions/thaw.ts is excluded by none and included by none
  • js/token-interface/src/instructions/transfer.ts is excluded by none and included by none
  • js/token-interface/src/instructions/unwrap.ts is excluded by none and included by none
  • js/token-interface/src/instructions/wrap.ts is excluded by none and included by none
  • js/token-interface/src/kit/index.ts is excluded by none and included by none
  • js/token-interface/src/load-options.ts is excluded by none and included by none
  • js/token-interface/src/read/associated-token-address.ts is excluded by none and included by none
  • js/token-interface/src/read/ata-utils.ts is excluded by none and included by none
  • js/token-interface/src/read/get-account.ts is excluded by none and included by none
  • js/token-interface/src/read/get-mint.ts is excluded by none and included by none
  • js/token-interface/src/read/index.ts is excluded by none and included by none
  • js/token-interface/src/spl-interface.ts is excluded by none and included by none
  • js/token-interface/src/types.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/approve-revoke.test.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/ata-read.test.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/burn.test.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/freeze-thaw.test.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/helpers.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/load.test.ts is excluded by none and included by none
  • js/token-interface/tests/e2e/transfer.test.ts is excluded by none and included by none
  • js/token-interface/tests/unit/account.test.ts is excluded by none and included by none
  • js/token-interface/tests/unit/instruction-builders.test.ts is excluded by none and included by none
  • js/token-interface/tests/unit/kit.test.ts is excluded by none and included by none
  • js/token-interface/tests/unit/public-api.test.ts is excluded by none and included by none
  • js/token-interface/tsconfig.json is excluded by none and included by none
  • js/token-interface/tsconfig.test.json is excluded by none and included by none
  • js/token-interface/vitest.config.ts is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
  • pnpm-workspace.yaml is excluded by none and included by none
  • scripts/format.sh is excluded by none and included by none
  • scripts/lint.sh is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fd2d15d8-ec58-4ad4-bca0-ed646ad6f437

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch swen/single-ix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SwenSchaeferjohann SwenSchaeferjohann marked this pull request as ready for review March 28, 2026 14:48
@ananas-block
Copy link
Copy Markdown
Contributor

nit: duplicated toBigIntAmount helper

toBigIntAmount(amount: number | bigint): bigint is identically defined in three files:

  • js/token-interface/src/instructions/transfer.ts:26
  • js/token-interface/src/instructions/approve.ts:14
  • js/token-interface/src/instructions/burn.ts:16

Extract to a shared utility.

@ananas-block
Copy link
Copy Markdown
Contributor

nit: inconsistent discriminator type declarations

Some discriminators are number constants written via writeUInt8(), others are Buffer used directly as instruction data:

// number (transfer.ts, approve.ts, burn.ts)
const LIGHT_TOKEN_TRANSFER_CHECKED_DISCRIMINATOR = 12;
const LIGHT_TOKEN_APPROVE_DISCRIMINATOR = 4;

// Buffer (freeze.ts, thaw.ts)
const LIGHT_TOKEN_FREEZE_ACCOUNT_DISCRIMINATOR = Buffer.from([10]);
const LIGHT_TOKEN_THAW_ACCOUNT_DISCRIMINATOR = Buffer.from([11]);

Pick one convention.

@ananas-block
Copy link
Copy Markdown
Contributor

nit: buffer over-allocation in ATA encoding

js/token-interface/src/instructions/ata.ts:119:

const buffer = Buffer.alloc(2000);

The Borsh-encoded CompressibleConfig is ~50 bytes. 2000 is 40x what's needed.

tilo-14 pushed a commit to tilo-14/x402-1 that referenced this pull request Mar 29, 2026
Replace @lightprotocol/compressed-token/unified with the new
@lightprotocol/token-interface package (pending publish of
Lightprotocol/light-protocol#2362).

- Use createTransferInstructions (object params, flat array return)
- Use getAta for aggregated balance check
- Use toKitInstructions from /kit export for native v2 conversion
- Delete convertV1InstructionToV2 from utils.ts (replaced by /kit)
- Remove pre-transaction batch splitting (SDK handles inline)
- Fix spec fee payer terminology
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants